home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 56
/
64er_Magazin_Sonderheft_56_19xx_Markt__Technik_de_Side_B.d64
/
matrix 2.6
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
15KB
|
698 lines
100 rem *****************************
110 rem * v 2.6 *
120 rem * matrix rechner mit editor *
130 rem * *
140 rem * (c)1988 viktor k.andor *
150 rem * *
160 rem * eduard moerike-str.6 *
170 rem * 2970 emden tel:44736 *
180 rem * *
190 rem *****************************
200 :
210 :
220 poke 55,226:poke 56,159:clr:poke 788,52
230 for i=0 to 25:read x:poke 40931+i,x:next i
240 data 032,253,174,032,158,183,138,072
250 data 032,253,174,032,158,183,104,168
260 data 024,032,240,255,032,253,174,076
270 data 164,170
280 at=40931
290 deffne(y)=int(1e7*y+.5)/1e7
300 for i=0 to 42:read a:poke 24576+i,a:next i
310 data 169,000,160,004,133,250,132,251
320 data 169,232,160,007,133,252,132,253
330 data 169,160,133,254,160,000,165,254
340 data 145,250,230,250,208,002,230,251
350 data 165,250,197,252,165,251,229,253
360 data 144,230,096
370 poke 53280,11:poke 53281,0:poke 53265,11:print"[129][147]":sys 24576
380 b1$="[146][159][221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
390 b2$="[146][159][171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
400 b0$="[129]":b3$="":b4$="[158]":b5$="":b6$="[154]":b8$="+ - * /?"
410 b9$="q x ? y?"
420 f1$="0102030405060708091011121314151617181920"
430 v1$="0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 "
440 v2$="1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 "
450 printb0$" 0 0 0 0 0 0 0 0 0 1 viktor k.andor"
460 printb0$" 1 2 3 4 5 6 7 8 9 0 1988"
470 printb0$" [146][159][176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174]"
480 printb0$" 01";b1$
490 printb0$" ";b2$
500 printb0$" 02";b1$
510 printb0$" ";b2$
520 printb0$" 03";b1$
530 printb0$" ";b2$
540 printb0$" 04";b1$
550 printb0$" ";b2$
560 printb0$" 05";b1$
570 printb0$" ";b2$
580 printb0$" 06";b1$
590 printb0$" ";b2$
600 printb0$" 07";b1$
610 printb0$" ";b2$
620 printb0$" 08";b1$
630 printb0$" ";b2$
640 printb0$" 09";b1$
650 printb0$" ";b2$
660 printb0$" 10";b1$
670 printb0$" [146][159][173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
680 gosub 6860
690 for i=4 to 21 step 2:sys at,26,i,b3$" ":next i
700 print"[159]"
710 sys at,25,02,"[176][192][192][192][192][192][192][192][192][192][192][192][192][174]"
720 sys at,25,22,"[173][192][192][192][192][192][192][192][192][192][192][192][192][189]"
730 gosub 6860
740 for i=4 to 21 step 2:sys at,26,i,b3$" ":next i
750 print"[159]"
760 for i=3 to 21 :sys at,25,i,"[221]":sys at,38,i,"[221]":next i:poke 53265,27
770 dim z(1,20,20),c(20,20),m(1,20,20),w(20):ma=0:tr=1
780 get a$:if a$=""then 780
790 if a$="i" then 1060
800 if a$="c" then 1950
810 if a$="d" then 2220
820 if a$="e" then gosub 6970:goto 910
830 if a$="q" then cl=0:gosub 6770
840 if a$="m" then 2860
850 if a$="r" then 2970
860 if a$="s" then 3100
870 if a$="w" then 3240
880 if a$="-" then 3600
890 goto 780
900 :
910 get a$:if a$=""then 910
920 if a$="+" then 3700
930 if a$="-" then 3830
940 if a$="*" then 3960
950 if a$="/" then 4290
960 if a$="q" then gosub 6860:k=0:goto 780
970 if a$="i" then 4200
980 if a$="d" then 4070
990 if a$="t" then 5550
1000 if a$="s"then 5710
1010 if a$="_"then 3350
1020 goto 910
1030 :
1040 rem input
1050 :
1060 sys at,26,3,b3$;b9$:o=5
1070 get a$:if a$=""then 1070
1080 if a$="x" then 1150
1090 if a$="y" then 1290
1100 if a$="q" then 1400
1110 goto 1070
1120 :
1130 rem input x
1140 :
1150 gosub 6410
1160 sys at,26,3,b3$" "b4$"matrix x":sys at,1,0,"x"
1170 gosub 1430:gosub 1490:gosub 6550
1180 mx=val(m$):f=mx
1190 gosub 1440:gosub 1490:gosub 6550
1200 nx=val(m$):v=nx
1210 gosub 1460
1220 if w=1 then 1170
1230 kx=mx:ky=nx:p=mx:r=nx
1240 da=ma
1250 goto 1390
1260 :
1270 rem input y
1280 :
1290 gosub 6410
1300 sys at,26,3,b3$" "b4$"matrix y":sys at,1,0,"y"
1310 gosub 1430:gosub 1490:gosub 6550
1320 my=val(m$):f=my
1330 gosub 1440:gosub 1490:gosub 6550
1340 ny=val(m$):v=ny
1350 gosub 1460
1360 if w=1 then 1310
1370 kx=my:ky=ny:p=my:r=ny
1380 da=tr
1390 xy=5:gosub 6460:gosub 6550:gosub 5360
1400 sys at,26,3,b3$"i = matrix "
1410 goto 780
1420 :
1430 sys at,3,23,b0$"m=?":sa=2:return
1440 sys at,3,23,b0$"n=?":sa=2:return
1450 :
1460 if f>20 or v>20 or f<1 or v<1 then gosub 6370:w=1:return
1470 w=0:return
1480 :
1490 m$="":sz=0
1500 get n$:if n$=""then 1500
1510 if asc(n$)=13 then return
1520 if asc(n$)=20 and sz>=1 then sz=sz-1:m$=left$(m$,sz):goto 1570
1530 if asc(n$)=69 or asc(n$)=45 or asc(n$)=46 then 1550
1540 if asc(n$)>57 or asc(n$)<48 then 1500
1550 m$=m$+n$:sz=sz+1
1560 if sz>sa then sz=sa:m$=left$(m$,sz)
1570 gosub 1610
1580 sys at,o,23,b0$;m$
1590 goto 1500
1600 :
1610 sys at,o,23,b0$" "
1620 return
1630 :
1640 if f1>3 and y<=10 then gosub 1760:y=y-1:f1=f1-2:goto 2560
1650 if f1>3 and y>1 then y=y-1:y1=y-10:gosub 1800:goto 2560
1660 goto 2600
1670 if f1<21 and y<f then gosub 1760:y=y+1:f1=f1+2:goto 2560
1680 if f>10 and y<f then gosub 1790:y=y+1:goto 2560
1690 goto 2600
1700 if v1>4 and x<=10 then gosub 1760:x=x-1:v1=v1-2:goto 2560
1710 if v1>4 and x>1 then x=x-1:gosub 1840:goto 2560
1720 goto 2600
1730 if v1<22 and x<v then gosub 1760:x=x+1:v1=v1+2:goto 2560
1740 if v>10 and x<v then x=x+1:gosub 1840:goto 2560
1750 goto 2600
1760 if abs(z(da,y,x))>1e-5 then sys at,v1,f1,b5$" ":return
1770 sys at,v1,f1,b4$" ":return
1780 :
1790 y1=y-9
1800 for i=3 to 21 step 2
1810 sys at,1,i,b0$;mid$(f1$,y1*2+1,2):y1=y1+1:next i
1820 return
1830 :
1840 if x<=10 then 1890
1850 sys at,4,0,b0$;mid$(v1$,x*2-19,19)
1860 sys at,4,1,b0$;mid$(v2$,x*2-19,19)
1870 return
1880 :
1890 sys at,4,0,b0$;mid$(v1$,1,19)
1900 sys at,4,1,b0$;mid$(v2$,1,19)
1910 return
1920 :
1930 rem clear
1940 :
1950 sys at,26,7,b3$;b9$
1960 get a$:if a$=""then 1960
1970 if a$="x" then 2040
1980 if a$="y" then 2140
1990 if a$="q" then 2090
2000 goto 1960
2010 :
2020 rem clear x
2030 :
2040 if mx=0 then f$="x":gosub 6580:goto 2090
2050 sys at,26,7,b3$" "b4$"clear x"
2060 cl=1:gosub 6770:if a$="n" then 2090
2070 kx=mx:ky=nx:xy=5:da=ma:p=mx:r=nx:gosub 5360
2080 gosub 6410
2090 sys at,26,7,b3$"c = clear "
2100 goto 780
2110 :
2120 rem clear y
2130 :
2140 if my=0 then f$="y":gosub 6580:goto 2090
2150 sys at,26,7,b3$" "b4$"clear y"
2160 cl=1:gosub 6770:if a$="n" then 2190
2170 kx=my:ky=ny:xy=5:da=tr:p=my:r=ny:gosub 5360
2180 gosub 6410
2190 goto 2090
2200 :
2210 rem daten eingabe
2220 :
2230 sys at,26,5,b3$;b9$:o=5
2240 get a$:if a$=""then 2240
2250 if a$="x" then 2320
2260 if a$="y" then 2420
2270 if a$="q" then 2370
2280 goto 2240
2290 :
2300 rem data x
2310 :
2320 if mx=0 then f$="x":gosub 6580:goto 2370
2330 sys at,26,5,b3$" "b4$"data x ":sys at,1,0,"x"
2340 kx=mx:ky=nx:gosub 6410:gosub 6460
2350 f=mx:v=nx
2360 da=ma:gosub 2500
2370 sys at,26,5,b3$"d = data "
2380 goto 780
2390 :
2400 rem data y
2410 :
2420 if my=0 then f$="y":gosub 6580:goto 2370
2430 sys at,26,5,b3$" "b4$"data y ":sys at,1,0,"y"
2440 f=my:v=ny:kx=my:ky=ny:gosub 6410:gosub 6460
2450 da=tr:gosub 2500
2460 sys at,26,5,b3$"d = data "
2470 if mx<>0 then f=mx:v=nx:kx=mx:ky=nx:gosub 6410:gosub 6460:sys at,1,0,"x"
2480 goto 780
2490 :
2500 f1=3:v1=4:sa=15
2510 gosub 1890
2520 y1=0:gosub 1800
2530 for y=1 to f
2540 for x=1 to v
2550 if x>=10 then v1=22:gosub 1840
2560 sys at,v1,f1,"?"
2570 gosub 1610
2580 m$=str$(fne(z(da,y,x)))
2590 sys at,3,23,b0$;"x=";m$
2600 get n$:if n$="" then 2600
2610 if asc(n$)=45 or asc(n$)=46 then 2630
2620 if asc(n$)<48 or asc(n$)>57 then 2650
2630 m$="":sz=0:gosub 1550:z(da,y,x)=val(m$)
2640 if asc(n$)= 13 then 2720
2650 if asc(n$)=147 or asc(n$)=19 then gosub 1890:goto 2800
2660 if asc(n$)=145 then 1640
2670 if asc(n$)= 17 then 1670
2680 if asc(n$)=157 then 1700
2690 if asc(n$)= 29 then 1730
2700 if asc(n$)= 13 then 2720
2710 goto 2600
2720 gosub 1760
2730 v1=v1+2
2740 next x
2750 gosub 1890
2760 v1=4
2770 f1=f1+2
2780 if y>=10 and y<f then f1=21:gosub 1790
2790 next y
2800 y1=0:gosub 1800
2810 gosub 6550:gosub 6460
2820 return
2830 :
2840 rem m=x
2850 :
2860 if mx=0 then f$="x":gosub 6580:goto 2920
2870 sys at,30,13,b4$"x [192]>m"
2880 mm=mx:nm=nx
2890 for x=1 to mx
2900 for y=1 to nx
2910 m(0,x,y)=z(ma,x,y):next y:next x
2920 sys at,30,13,b3$"x [192]>m"
2930 goto 780
2940 :
2950 rem x=m
2960 :
2970 if mm=0 then f$="m":gosub 6580:goto 3050
2980 sys at,30,15,b4$"m [192]>x":sys at,1,0,"x"
2990 gosub 6410
3000 mx=mm:nx=nm
3010 kx=mm:ky=nm:gosub 6460
3020 for x=1 to mm
3030 for y=1 to nm
3040 z(ma,x,y)=m(0,x,y):next y:next x
3050 sys at,30,15,b3$"m [192]>x"
3060 goto 780
3070 :
3080 rem x=x+m
3090 :
3100 if mm=0 then f$="m":gosub 6580:goto 3190
3110 sys at,30,17,b4$"x+m [192]>m":sys at,1,0,"x"
3120 if mm=mx or nm=nx then 3140
3130 gosub 6620:goto 3190
3140 for x=1 to mm
3150 for y=1 to nm
3160 m(0,x,y)=m(0,x,y)+z(ma,x,y)
3170 next y
3180 next x
3190 sys at,30,17,b3$"x+m [192]>m"
3200 goto 780
3210 :
3220 rem vertauschen von x,y
3230 :
3240 if mx=0 and my=0 then f$="":gosub 6580:goto 3300
3250 sys at,30,19,b4$"x< [192] >y":sys at,1,0,"x"
3260 c=ma:ma=tr:tr=c
3270 c=mx:mx=my:my=c:c=nx:nx=ny:ny=c
3280 kx=mx:ky=nx:gosub 6410
3290 if mx<>0 then gosub 6460
3300 sys at,30,19,b3$"x< [192] >y"
3310 goto 780
3320 :
3330 rem drehen
3340 :
3350 if mx=0 then f$="x":gosub 6580:gosub 6860:goto 780
3360 sys at,26,21,b3$"q _ ? ^?"
3370 get a$:if a$="" then 3370
3380 if a$="_" then sys at,26,21,b3$" "b4$"_"b3$" ":goto 3420
3390 if a$="^" then sys at,26,21,b3$" "b4$"^"b3$" ":goto 3460
3400 if a$="q" then 3550
3410 goto 3370
3420 if mx<>nx then gosub 6530:gosub 6740:goto 3550
3430 g=mx
3440 for x=1 to mx:for y=1 to mx:c(x,y)=z(ma,x,y):next y:next x
3450 for x=1 to mx:for y=1 to mx:z(ma,x,y)=c(y,g):next y:g=g-1:next x
3460 gosub 3470:goto 3550
3470 kx=mx:ky=nx:x=1:y=1
3480 if kx>10 then kx=10
3490 if ky>10 then ky=10
3500 for f1=3 to 2+2*kx step 2
3510 for v1=4 to 3+2*ky step 2
3520 if abs(z(ma,x,y))>1e-5 then sys at,v1,f1,b5$" ":goto 3540
3530 sys at,v1,f1,b4$" "
3540 y=y+1:next v1:y=1:x=x+1:next f1:return
3550 sys at,26,21,b3$"_ = drehen x"
3560 goto 910
3570 :
3580 rem vertauschen der vorzeichen
3590 :
3600 if mx=0 then f$="x":gosub 6580:goto 3650
3610 sys at,30,21,b4$"+/- [192]>x"
3620 for x=1 to mx
3630 for y=1 to nx
3640 z(ma,x,y)=z(ma,x,y)*-1:next y:next x
3650 sys at,30,21,b3$"+/- [192]>x"
3660 goto 780
3670 :
3680 rem x=x+y
3690 :
3700 if mx=0 or my=0 then f$="x oder y":gosub 6580:gosub 6860:goto 780
3710 if mx<>my or nx<>ny then gosub 6530:gosub 6620:goto 3780
3720 sys at,30,3,b4$"x+y [192]>x":sys at,1,0,"x"
3730 for x=1 to mx
3740 for y=1 to nx
3750 z(ma,x,y)=z(ma,x,y)+z(tr,x,y)
3760 next y
3770 next x
3780 sys at,30,3,b3$"x+y [192]>x"
3790 goto 910
3800 :
3810 rem x=x-y
3820 :
3830 if mx=0 or my=0 then f$="x oder y":gosub 6580:gosub 6860:goto 780
3840 if mx<>my or nx<>ny then gosub 6530:gosub 6620:goto 3910
3850 sys at,30,5,b4$"x-y [192]>x":sys at,1,0,"x"
3860 for x=1 to mx
3870 for y=1 to nx
3880 z(ma,x,y)=z(ma,x,y)-z(tr,x,y)
3890 next y
3900 next x
3910 sys at,30,5,b3$"x-y [192]>x"
3920 goto 910
3930 :
3940 rem x=x*y
3950 :
3960 if mx=0 or my=0 then f$="x oder y":gosub 6580:gosub 6860:goto 780
3970 sys at,30,7,b4$"x*y [192]>x"
3980 gosub 6240
3990 gosub 6410
4000 k=k+1:if k=2 then k=0:gosub 6860:gosub 3470:goto 2350
4010 kx=mx:ky=nx:gosub 6460
4020 sys at,30,7,b3$"x*y [192]>x":sys at,1,0,"x":k=0
4030 goto 910
4040 :
4050 rem determinante
4060 :
4070 if mx=0 then f$="x":gosub 6580:gosub 6860:goto 780
4080 if mx<>nx then gosub 6530:gosub 6740:goto 910
4090 sys at,30,17,b4$"determ.x"
4100 if mx=1 and nx=1 then de=z(ma,1,1):goto 4120
4110 xy=1:p=mx:r=nx:gosub 6030
4120 sys at,3,23,b0$"determinante=";de
4130 sys at,30,17,b3$"determ.x"
4140 get a$:if a$="" then 4140
4150 gosub 6550
4160 goto 920
4170 :
4180 rem reziprokwert von x
4190 :
4200 if mx=0 then f$="x":gosub 6580:gosub 6860:goto 780
4210 if mx<>nx then gosub 6530:gosub 6740:goto 910
4220 sys at,30,13,b4$"invers x":sys at,1,0,"x"
4230 xy=1:da=ma:in=mx:p=mx:r=nx:gosub 4740
4240 sys at,30,13,b3$"invers x":sys at,1,0,"x"
4250 goto 910
4260 :
4270 rem x=x/y
4280 :
4290 if mx=0 or my=0 then f$="x oder y":gosub 6580:gosub 6860:goto 780
4300 if my<>ny then gosub 6530:gosub 6740:goto 4420
4310 if nx<>ny then gosub 6530:gosub 6620:goto 4420
4320 sys at,30,9,b4$"x*iy ->x"
4330 :
4340 xy=2:da=tr:in=my:p=my:r=ny
4350 for x=1 to my:for y=1 to ny:m(1,x,y)=z(tr,x,y):next y:next x
4360 gosub 4740
4370 gosub 6240
4380 p=my:r=ny
4390 for x=1 to my:for y=1 to ny:z(tr,x,y)=m(1,x,y):next y:next x
4400 gosub 6410
4410 kx=mx:ky=nx:gosub 6460
4420 sys at,30,9,b3$"x*iy ->x":sys at,1,0,"x"
4430 goto 910
4440 :
4450 rem subrutin zum reziprokwert
4460 :
4470 k=1:for x=1 to cx
4480 c(x,x)=c(x,x)+1
4490 next x
4500 b=cx
4510 h=b
4520 d=c(h,h)-1
4530 if d=0 then k=0:return
4540 gosub 4620
4550 b=b-1
4560 if b>0 then 4510
4570 for x=1 to cx
4580 c(x,x)=c(x,x)-1
4590 next x
4600 return
4610 :
4620 for f=1 to cx
4630 h=b
4640 c(h,f)=c(h,f)/d
4650 next f
4660 for e=1 to cx
4670 if b=e then 4720
4680 h=b:d=c(e,b)
4690 for f=1 to cx
4700 c(e,f)=c(e,f)-d*c(b,f)
4710 next f
4720 next e:return
4730 :
4740 w=0:cx=in:dr=0:gosub 5360:if in=1 then gosub 4470:goto 4960
4750 for i=in-1 to 2 step-1
4760 if c(i,i)=0 or abs(c(i,i))<abs(c(i-1,i))then 4790
4770 next i
4780 goto 4800
4790 dr=1:gosub 5410
4800 for x=0 to in-1:w(x)=0:next x
4810 if c(1 , 1)=0 then gosub 4990
4820 if c(in,in)=0 then gosub 5080
4830 if in>2 then gosub 5220
4840 gosub 4470
4850 if k=0 then gosub 6830:return
4860 if in<3 then 4930
4870 for i=2 to in-1
4880 for x=1 to in
4890 if w(i)=0 then 4910
4900 c=c(x,w(i)):c(x,w(i))=c(x,i):c(x,i)=c
4910 next x
4920 next i
4930 if w(1)<>0 then pv=1:w=in:gosub 5170
4940 if w(0)<>0 then pv=0:w=1:gosub 5170
4950 if dr<>0 then gosub 5410
4960 xy=xy+2:gosub 5360:xy=xy-2
4970 return
4980 :
4990 for x=1 to in
5000 if c(1,x)=0 then 5020
5010 w(0)=x:goto 5030
5020 next x
5030 for x=1 to in
5040 c=c(x,w(0)):c(x,w(0))=c(x,1):c(x,1)=c
5050 next x
5060 return
5070 :
5080 for x=in to 1 step-1
5090 if c(in,x)=0then 5110
5100 w(1)=x:goto 5120
5110 next x
5120 for x=1 to in
5130 c=c(x,w(1)):c(x,w(1))=c(x,in):c(x,in)=c
5140 next x
5150 return
5160 :
5170 for x=1 to in
5180 c=c(w(pv),x):c(w(pv),x)=c(w,x):c(w,x)=c
5190 next x
5200 return
5210 :
5220 for i=in-1 to 2 step-1
5230 if c(i,i)=0 or abs(c(i,i))<abs(c(i-1,i)) then 5250
5240 goto 5330
5250 for x=i-1 to 1 step-1
5260 if c(x,i)=0 or abs(c(x,i))<abs(c(x+1,i)) then 5320
5270 w(i)=x
5280 for y=1 to in
5290 c=c(x,y):c(x,y)=c(i,y):c(i,y)=c
5300 next y
5310 x=1
5320 next x
5330 next i
5340 return
5350 :
5360 for x=1 to p:for y=1 to r
5370 on xy gosub 5470,5480,5490,5500,5510
5380 next y:next x
5390 return
5400 :
5410 g=in:for x=1 to in:for y=1 to in
5420 z(da,x,y)=c(y,g)
5430 next y:g=g-1:next x
5440 gosub 5360
5450 return
5460 :
5470 c(x,y)=z(ma,x,y):return
5480 c(x,y)=z(tr,x,y):return
5490 z(ma,x,y)=c(x,y):return
5500 z(tr,x,y)=c(x,y):return
5510 z(da,x,y)=0:return
5520 :
5530 rem transposition
5540 :
5550 if mx=0 then f$="x":gosub 6580:gosub 6860:goto 780
5560 sys at,30,15,b4$"transp.x"
5570 xy=1:p=mx:r=nx:gosub 5360
5580 for x=1 to mx
5590 for y=1 to nx
5600 z(ma,y,x)=c(x,y)
5610 next y
5620 next x
5630 c=mx:mx=nx:nx=c
5640 gosub 6410
5650 kx=mx:ky=nx:gosub 6460
5660 sys at,30,15,b3$"transp.x":sys at,1,0,"x"
5670 goto 910
5680 :
5690 rem skalar operation
5700 :
5710 if mx=0 then f$="x":gosub6580:gosub6860:goto 780
5720 sys at,26,19,b3$"q ";b8$
5730 get a$:if a$="" then 5730
5740 if a$="+"then u=1:w=1:goto 5810
5750 if a$="-"then u=2:w=3:goto 5810
5760 if a$="*"then u=3:w=5:goto 5810
5770 if a$="/"then u=3:goto 5860
5780 if a$="q"then goto 5980
5790 goto 5730
5800 :
5810 sys at,29+w,19,b4$;mid$(b8$,w,1):gosub 5910
5820 for x=1 to mx:for y=1 to nx
5830 on u gosub 5950,5960,5970
5840 next y:next x
5850 goto 5980
5860 sys at,36,19,b4$"/":gosub 5910
5870 xy=1:da=ma:in=mx:p=mx:r=nx
5880 gosub 4740
5890 goto 5820
5900 :
5910 sys at,3,23,b0$"skalar=":sa=15:o=10:gosub 1490
5920 n=val(m$)
5930 gosub 6550:return
5940 :
5950 z(ma,x,y)=n+z(ma,x,y):return
5960 z(ma,x,y)=n-z(ma,x,y):return
5970 z(ma,x,y)=n*z(ma,x,y):return
5980 sys at,26,19,b3$"s = skalar x"
5990 goto 910
6000 :
6010 rem subrutin zur determinante
6020 :
6030 gosub 5360
6040 k=0:b=p:e=1
6050 i=b
6060 d=c(i,i):if d=0 then gosub 6110
6070 if k=1 then e=0:goto 6100
6080 e=d*e:gosub 6180
6090 b=b-1:if b>1 then 6050
6100 e=e*c(1,1):de=e:return
6110 for f=1 to b-1
6120 d=c(f,i):if d<>0 then 6160
6130 next f
6140 k=1
6150 return
6160 for g=1 to b:c(i,g)=c(i,g)+c(f,g):next g
6170 return
6180 for f=1 to b-1:l=c(f,i)/d:for g=1 to b-1:c(f,g)=c(f,g)-l*c(i,g)
6190 next g:next f
6200 return
6210 :
6220 rem subrutin zum produkt
6230 :
6240 if nx<>my then gosub 6530:gosub 6670:return
6250 for x=1 to mx
6260 for y=1 to ny
6270 c(x,y)=0
6280 for z=1 to nx
6290 c(x,y)=c(x,y)+z(ma,x,z)*z(tr,z,y)
6300 next z
6310 next y
6320 next x
6330 xy=3:p=mx:r=ny:gosub 5360
6340 nx=ny
6350 return
6360 :
6370 gosub 6530
6380 sys at,3,23,b0$"definition 1-20"
6390 goto 6540
6400 :
6410 for y=3 to 2+2*10 step 2
6420 for x=4 to 3+2*10 step 2
6430 sys at,x,y," ":next x:next y
6440 return
6450 :
6460 if kx>10 then kx=10
6470 if ky>10 then ky=10
6480 for y=3 to 2+2*kx step 2
6490 for x=4 to 3+2*ky step 2
6500 sys at,x,y,b6$" ":next x:next y
6510 return
6520 :
6530 sys at,3,23,b0$"error !! "
6540 for i=1 to 2000:next i
6550 sys at,3,23,b0$" "
6560 return
6570 :
6580 sys at,3,23,b0$"keine definition in matrix ";f$
6590 gosub 6540
6600 return
6610 :
6620 sys at,3,23,b0$"matrizen verschiedenen formats"
6630 gosub 6540
6640 return
6650 :
6660 gosub 6530
6670 sys at,3,23,b0$"(n) in matrix x und (m) in matrix y":for i=1 to 900:next i
6680 gosub 6540
6690 sys at,3,23,b0$"sind ungleich"
6700 gosub 6540
6710 return
6720 :
6730 gosub 6530
6740 sys at,3,23,b0$"matriz ist nicht quadratisch"
6750 goto 6700
6760 :
6770 sys at,3,23,b0$"sind sie sicher ? j/n"
6780 get a$:if a$=""then 6780
6790 if a$="j" and cl=0 then gosub 6550:poke 788,49:print"[145][145][145]":end
6800 if a$="j" and cl=1 then gosub 6550:return
6810 if a$="n" then gosub 6550:return
6820 goto 6780
6830 sys at,3,23,b0$"matrix ist singulaer"
6840 goto 6700
6850 :
6860 sys at,26,3,b3$"i = matrix "
6870 sys at,26,5,b3$"d = data "
6880 sys at,26,7,b3$"c = clear "
6890 sys at,26,9,b3$"e = menue ii"
6900 sys at,26,11,b3$"q = quit "
6910 sys at,26,13,b3$"m = x [192]>m "
6920 sys at,26,15,b3$"r = m [192]>x "
6930 sys at,26,17,b3$"s = x+m [192]>m "
6940 sys at,26,19,b3$"w = x< [192] >y "
6950 sys at,26,21,b3$"- = +/- [192]>x "
6960 return
6970 sys at,26,3,b3$"+ = x+y [192]>x"
6980 sys at,26,5,b3$"- = x-y [192]>x"
6990 sys at,26,7,b3$"* = x*y [192]>x"
7000 sys at,26,9,b3$"/ = x*iy [192]>x"
7010 sys at,26,13,b3$"i = invers x"
7020 sys at,26,15,b3$"t = transp.x"
7030 sys at,26,17,b3$"d = determ.x"
7040 sys at,26,19,b3$"s = skalar x"
7050 sys at,26,21,b3$"_ = drehen x"
7060 return